package com.brillilab.common.rocketmq;

import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Data
public class OnsMessageVo implements Serializable{
	
	private static final long serialVersionUID = 1L;

	/** 类型 */
	private Integer type;

	/** 标题 */
	private String title;

	private Long messageId;

	private String messageData;

	private List<String> deviceNos;
	/** 
	 * WebSocket链接的接收用户，isAppoint为true必填 
	 */
	private List<String> socketIds;

	/** 数据 */
	private Object data;

	public OnsMessageVo() {
		super();
	}

	public OnsMessageVo(Integer type, String title, Long messageId) {
		this.type = type;
		this.title = title;
		this.messageId = messageId;
	}

	public OnsMessageVo(Integer type,String title,List<String> deviceNos,Map data) {
		this.type = type;
		this.title = title;
		this.deviceNos = deviceNos;
		this.data = data;
	}

	/**
	 * 定接收用户推送
	 * @param onsMqEnum
	 * @param data
	 * @param socketIds
	 */
	public OnsMessageVo(OnsMessageEnum onsMqEnum, Object data, List<String> socketIds) {
		super();
		this.type = onsMqEnum.getType();
		this.title = onsMqEnum.getTitle();
		this.socketIds = socketIds;
		this.data = data;
	}

	public OnsMessageVo(OnsMessageEnum onsMqEnum, Object data, String socketId) {
		super();
		this.type = onsMqEnum.getType();
		this.title = onsMqEnum.getTitle();
		this.socketIds = new ArrayList<>();
		this.socketIds.add(socketId);
		this.data = data;
	}
	
}
